<template>
  <div>
      <el-form :model="dataForm" :rules="rules" ref="dataForm" inline size="small" onsubmit="return false">
        <el-row>
          <el-col :span="24">
            <el-form-item class="form-item" prop="anewAuditReason" label="重审原因" label-width="105px" style="width: 100%;">
              <el-select placeholder="重审原因" v-model="dataForm.anewAuditReason" clearable collapse-tags required style="width: 100%;">
                <el-option v-for="(item, key) in dicts['anew_audit_reason'].childMap" :key="key" :label="item" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item class="form-item" prop="anewAuditRemark" label="重审原因描述" style="width: 100%;">
              <el-input clearable type="textarea" :rows="5" resize="none" placeholder="请输入重审原因" v-model="dataForm.anewAuditRemark" required style="width: 100%;"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    <el-row class="table-btn">
      <el-button size="small" @click="close">取消</el-button>
      <el-button type="primary" @click="submit" size="small">
        <fa-icon class="fa-check" />确定</el-button>
    </el-row>
  </div>
</template>

<script>
import { mapState } from 'vuex'
// 分派受理人
export const ACCEPTOR_HEAD_LIST = [
  { prop: 'realName', label: '员工姓名' },
  { prop: 'userName', label: '工号' },
  { prop: 'organizationName', label: '所属机构' }
]
export const REVIEW_LIST = {
  '1': '原因1',
  '2': '原因2'
}
export default {
  components: { },
  data () {
    return {
      ACCEPTOR_HEAD_LIST,
      REVIEW_LIST,
      dataForm: {
        anewAuditReason: '',
        anewAuditRemark: ''
      },
      rules: {
        anewAuditReason: [
          { required: true, trigger: 'blur', message: '重审原因不能为空' }
        ],
        anewAuditRemark: [
          { required: true, trigger: 'blur', message: '重审备注不能为空' }
        ]
      }
    }
  },
  mounted () {},
  methods: {
    // 提交重审信息
    submit () {
      this.$refs['dataForm'].validate(valid => {
        if (valid) {
          this.$emit('updataSuccess', this.dataForm)
        } else {
          return false
        }
      })
    },
    close () {
      this.$emit('updataClose', false)
    }
  },
  computed: {
    ...mapState({
      dicts: state => state.common.dicts
    })
  }
}
</script>

<style lang="less" scoped>
.table-btn {
  margin: 20px;
  text-align: right;
}
.tc-table thead .el-table-column--selection.is-leaf .el-checkbox{
  display: none;
}
.form-item{
  width: 100%;
}
.el-form-item{
    .el-form-item__content{
      width: 100%;
    }
}
</style>
